package com.neuedu.yyzx.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.neuedu.yyzx.po.Books;
import com.neuedu.yyzx.service.BooksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.List;

@RestController
@RequestMapping("/books")
public class BooksController {
	@Autowired
	private BooksService booksService;
	@RequestMapping("/selectBooksByName")
	public List<Books> selectBooksByName(String title){
		return booksService.selectBooksByName(title);
	}
	@RequestMapping("/updateByName")
	public int updateByName(String title,BigDecimal price,int stock) {
		
		return booksService.updateByName(title,price,stock);
	}
	@RequestMapping("/page")
	public IPage<Books> getPage(int curr){
		return booksService.getPage(curr);
	}
}
